package com.ry.bhwktapp.home.ui
//延时初始化的学习
class KtBase78 {
    lateinit var kk:String

    //模拟服务器加载，类似懒加载
    fun load(){
        kk ="初始化了"
    }

    fun showLoad(){

        if (::kk.isInitialized) {
            println("=====$kk")
        }else{
            println("=====尚未初始化")
        }
    }
}

fun main() {
    val p = KtBase78()
//    p.load()//用到时候再初始化
    p.showLoad()//直接调用这个方法报：lateinit property kk has not been initialized 要先初始化（p.load()）才行
}